#include "stm32f10x.h"
#include "Delay.h"
#include "key.h"
#include "LED.h"

#define PAout(x) *(volatile uint32_t *)(0x42000000+(GPIOA_BASE + 0x0C -0x40000000)*32 + x*4)
#define PBin(x) *(volatile uint32_t *)(0x42000000+(GPIOB_BASE + 0x08 -0x40000000)*32 + x*4)	
int main(void)
{
	LED_Init();
	Key_Init();
	while (1)
	{
		PAout(8)=0;
		Delay_ms(200);
		PAout(8)=1;
		Delay_ms(200);
		
		if(PBin(0) == 0)
		{
			PAout(15) = 0;
		}
		else
		{
			PAout(15) = 1;
		}
	}
}

